//浏览器获取id
var id = window.location.search.split('=')[1];

$.ajax({
	url: '/admin/api/books/get.php?id=' + id,
	method: 'GET',
	async: false,
	success: function (data) {
		window.BOOK_CONTENT = data.data.imageCount;
	}
});


var normalPath = "../admin/uploads/books/" + id + "/pages/";
var largePath = "../admin/uploads/books/" + id + "/large/";
var thumbPath = "../admin/uploads/books/" + id + "/thumb/";

// 获取实际页数
var realTotalPages = window.BOOK_CONTENT

var aliasConfig = {
	appName: ["", "", ""],
	totalPageCount: [],
	largePageWidth: [],
	largePageHeight: [],
	normalPath: [],
	largePath: [],
	thumbPath: [],

	ToolBarsSettings: [],
	TitleBar: [],
	appLogoIcon: ["appLogoIcon"],
	appLogoLinkURL: ["appLogoLinkURL"],
	bookTitle: [],
	bookDescription: [],
	ButtonsBar: [],
	ShareButton: [],
	ShareButtonVisible: ["socialShareButtonVisible"],
	ThumbnailsButton: [],
	ThumbnailsButtonVisible: ["enableThumbnail"],
	ZoomButton: [],
	ZoomButtonVisible: ["enableZoomIn"],
	FlashDisplaySettings: [],
	MainBgConfig: [],
	bgBeginColor: ["bgBeginColor"],
	bgEndColor: ["bgEndColor"],
	bgMRotation: ["bgMRotation"],
	backGroundImgURL: ["mainbgImgUrl", "innerMainbgImgUrl"],
	pageBackgroundColor: ["pageBackgroundColor"],
	flipshortcutbutton: [],
	BookMargins: [],
	topMargin: [],
	bottomMargin: [],
	leftMargin: [],
	rightMargin: [],
	HTMLControlSettings: [],
	linkconfig: [],
	LinkDownColor: ["linkOverColor"],
	LinkAlpha: ["linkOverColorAlpha"],
	OpenWindow: ["linkOpenedWindow"],
	searchColor: [],
	searchAlpha: [],
	SearchButtonVisible: ["searchButtonVisible"],

	productName: [],
	homePage: [],
	enableAutoPlay: ["autoPlayAutoStart"],
	autoPlayDuration: ["autoPlayDuration"],
	autoPlayLoopCount: ["autoPlayLoopCount"],
	BookMarkButtonVisible: [],
	googleAnalyticsID: ["googleAnalyticsID"],
	OriginPageIndex: [],
	HardPageEnable: ["isHardCover"],
	UIBaseURL: [],
	RightToLeft: ["isRightToLeft"],

	LeftShadowWidth: ["leftPageShadowWidth"],
	LeftShadowAlpha: ["pageShadowAlpha"],
	RightShadowWidth: ["rightPageShadowWidth"],
	RightShadowAlpha: ["pageShadowAlpha"],
	ShortcutButtonHeight: [],
	ShortcutButtonWidth: [],
	AutoPlayButtonVisible: ["enableAutoPlay"],
	DownloadButtonVisible: ["enableDownload"],
	DownloadURL: ["downloadURL"],
	HomeButtonVisible: ["homeButtonVisible"],
	HomeURL: ['btnHomeURL'],
	BackgroundSoundURL: ['bacgroundSoundURL'],
	//TableOfContentButtonVisible:["BookMarkButtonVisible"],
	PrintButtonVisible: ["enablePrint"],
	toolbarColor: ["mainColor", "barColor"],
	loadingBackground: ["mainColor", "barColor"],
	BackgroundSoundButtonVisible: ["enableFlipSound"],
	FlipSound: ["enableFlipSound"],
	MiniStyle: ["userSmallMode"],
	retainBookCenter: ["moveFlipBookToCenter"],
	totalPagesCaption: ["totalPageNumberCaptionStr"],
	pageNumberCaption: ["pageIndexCaptionStrs"]
};
var aliasLanguage = {
	frmPrintbtn: ["frmPrintCaption"],
	frmPrintall: ["frmPrintPrintAll"],
	frmPrintcurrent: ["frmPrintPrintCurrentPage"],
	frmPrintRange: ["frmPrintPrintRange"],
	frmPrintexample: ["frmPrintExampleCaption"],
	btnLanguage: ["btnSwicthLanguage"],
	btnTableOfContent: ["btnBookMark"]
}
	;
var bookConfig = {
	appName: 'flippdf',
	totalPageCount: realTotalPages,
	largePageWidth: 1080,
	largePageHeight: 1440,
	normalPath: normalPath,
	largePath: largePath,
	thumbPath: thumbPath,

	ToolBarsSettings: "",
	TitleBar: "",
	appLogoLinkURL: "",
	bookTitle: "FLIPBUILDER",
	bookDescription: "",
	ButtonsBar: "",
	ShareButton: "",

	ThumbnailsButton: "",
	ThumbnailsButtonVisible: "Show",
	ZoomButton: "",
	ZoomButtonVisible: "Yes",
	FlashDisplaySettings: "",
	MainBgConfig: "",
	bgBeginColor: "#cccccc",
	bgEndColor: "#eeeeee",
	bgMRotation: 45,
	pageBackgroundColor: "#FFFFFF",
	flipshortcutbutton: "Show",
	BookMargins: "",
	topMargin: 10,
	bottomMargin: 10,
	leftMargin: 10,
	rightMargin: 10,
	HTMLControlSettings: "",
	linkconfig: "",
	LinkDownColor: "#808080",
	LinkAlpha: 0.5,
	OpenWindow: "_Blank",

	BookMarkButtonVisible: 'true',
	productName: 'Demo created by Flip PDF',
	homePage: 'http://www.jq22.com/',
	isFlipPdf: "true",
	TableOfContentButtonVisible: "true",
	searchTextJS: 'javascript/search_config.js',
	searchPositionJS: undefined,
	isText: true,
	pageBackground: "#ffffff",
	textColor: "#333333",
	fontSize: "16px",
	lineHeight: "1.6"
};


bookConfig.loadingCaption = "Loading";
bookConfig.loadingCaptionColor = "#DDDDDD";
bookConfig.loadingBackground = "#000000";
bookConfig.appLogoIcon = "files/extfiles/appLogoIcon.png";
bookConfig.appLogoLinkURL = "http://www.jq22.com";
bookConfig.logoHeight = "40";
bookConfig.logoPadding = "0";
bookConfig.logoTop = "0";
bookConfig.HomeURL = "http://www.jq22.com";
bookConfig.appLogoOpenWindow = "Blank";
bookConfig.toolbarColor = "#000000";
bookConfig.iconColor = "#ECF5FB";
bookConfig.pageNumColor = "#333333";
bookConfig.iconFontColor = "#FFFFFF";
bookConfig.FlipSound = "Enable";
bookConfig.QRCode = "Hide";
bookConfig.HomeButtonVisible = "Hide";
bookConfig.ShareButtonVisible = "Show";
bookConfig.ThumbnailsButtonVisible = "Show";
bookConfig.thumbnailColor = "#333333";
bookConfig.thumbnailAlpha = "70";
bookConfig.ZoomButtonVisible = "Yes";
bookConfig.BookMarkButtonVisible = "Hide";
bookConfig.TableOfContentButtonVisible = "Show";
bookConfig.bookmarkBackground = "#000000";
bookConfig.bookmarkFontColor = "#cccccc";
bookConfig.SearchButtonVisible = "Show";
bookConfig.leastSearchChar = "3";
bookConfig.searchFontColor = "#FFFFFF";
bookConfig.PrintButtonVisible = "Yes";
bookConfig.BackgroundSoundButtonVisible = "Enable";
bookConfig.BackgroundSoundLoop = "-1";
bookConfig.AutoPlayButtonVisible = "Yes";
bookConfig.autoPlayAutoStart = "No";
bookConfig.autoPlayDuration = "9";
bookConfig.autoPlayLoopCount = "1";
bookConfig.minZoomWidth = "700";
bookConfig.minZoomHeight = "518";
bookConfig.mouseWheelFlip = "yes";
bookConfig.DownloadButtonVisible = "Hide";
bookConfig.DownloadURL = "http://www.jq22.com/";
bookConfig.enableDownload = "Yes";
bookConfig.downloadURL = "http://www.jq22.com/";
bookConfig.bgBeginColor = "#E2E2E2";
bookConfig.bgEndColor = "#E2E2E2";
bookConfig.bgMRotation = "90";
bookConfig.backGroundImgURL = " ";
bookConfig.LeftShadowWidth = "90";
bookConfig.LeftShadowAlpha = "0.6";
bookConfig.RightShadowWidth = "55";
bookConfig.RightShadowAlpha = "0.6";
bookConfig.HardPageEnable = "No";
bookConfig.hardCoverBorderWidth = "8";
bookConfig.borderColor = "#572F0D";
bookConfig.outerCoverBorder = "Yes";
bookConfig.cornerRound = "8";
bookConfig.pageBackgroundColor = "#E8E8E8";
bookConfig.flipshortcutbutton = "Show";
bookConfig.BindingType = "side";
bookConfig.RightToLeft = "No";
bookConfig.flippingTime = "0.3";
bookConfig.retainBookCenter = "Yes";
bookConfig.FlipStyle = "Flip";
bookConfig.showDoublePage = "Yes";
bookConfig.topMargin = "10";
bookConfig.bottomMargin = "10";
bookConfig.leftMargin = "10";
bookConfig.rightMargin = "10";
bookConfig.leftMarginOnMobile = "0";
bookConfig.topMarginOnMobile = "0";
bookConfig.rightMarginOnMobile = "0";
bookConfig.bottomMarginOnMobile = "0";
bookConfig.maxWidthToSmallMode = "400";
bookConfig.maxHeightToSmallMode = "300";
bookConfig.LinkDownColor = "#800080";
bookConfig.LinkAlpha = "0.2";
bookConfig.OpenWindow = "Blank";
bookConfig.showLinkHint = "No";
bookConfig.searchFontColor = "#FFFDDD";
bookConfig.totalPageCount = realTotalPages;
bookConfig.largePageWidth = 1024;
bookConfig.largePageHeight = 1448;
bookConfig.securityType = "1";
bookConfig.bookTitle = "２０１６年《医师—妇产科》";
bookConfig.productName = " ";
bookConfig.homePage = " ";
bookConfig.searchPositionJS = "javascript/search_config.js";
bookConfig.searchTextJS = "javascript/search_config.js";
bookConfig.normalPath = normalPath;
bookConfig.largePath = largePath;
bookConfig.thumbPath = thumbPath;
bookConfig.userListPath = "files/extfiles/users.js";
var language = [];
;
function orgt(s) {
	return binl2hex(core_hx(str2binl(s), s.length * chrsz));
};
;
var pageEditor = {
	"setting": {},
	"pageAnnos": new Array(realTotalPages).fill([])
};

bookConfig.hideMiniFullscreen = true;
if (language && language.length > 0 && language[0] && language[0].language) {
	bookConfig.language = language[0].language;
}

try {
	for (var i = 0; pageEditor != undefined && i < pageEditor.length; i++) {
		if (pageEditor[i].length == 0) {
			continue;
		}
		for (var j = 0; j < pageEditor[i].length; j++) {
			var anno = pageEditor[i][j];
			if (anno == undefined) continue;
			if (anno.overAlpha == undefined) {
				anno.overAlpha = bookConfig.LinkAlpha;
			}
			if (anno.outAlpha == undefined) {
				anno.outAlpha = 0;
			}
			if (anno.downAlpha == undefined) {
				anno.downAlpha = bookConfig.LinkAlpha;
			}
			if (anno.overColor == undefined) {
				anno.overColor = bookConfig.LinkDownColor;
			}
			if (anno.downColor == undefined) {
				anno.downColor = bookConfig.LinkDownColor;
			}
			if (anno.outColor == undefined) {
				anno.outColor = bookConfig.LinkDownColor;
			}
			if (anno.annotype == 'com.mobiano.flipbook.pageeditor.TAnnoLink') {
				anno.alpha = bookConfig.LinkAlpha;
			}
		}
	}
} catch (e) {
}
try {
	$.browser.device = 2;
} catch (ee) {
}
